package com.etbsms.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Projections;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.etbsms.dao.IFilesDAO;
import com.etbsms.domain.Files;

@Repository
@Component("filesDAO")
public class FilesDAOImpl extends GenericDAOImpl<Files, Integer> 
	implements IFilesDAO {

	@Override
	public void info() {
		Session session = sessionFactory.openSession();
		Criteria criteria = session.createCriteria(Files.class);
		criteria.setProjection(Projections.sum("size"));
		
		System.out.println(criteria.list().get(0));
		session.close();
	}



}
